package com.rran.study.designpattern.structural.proxy;

import java.lang.reflect.Proxy;

/**
 * @author yy
 * @Type JDKProxyClient.java
 * @Desc
 * */
public class JDKProxyClient {

    public static void main(String[] args) {
        Subject target = new RealSubject();
        JDKDynamicProxy jdkDynamicProxy = new JDKDynamicProxy(target);
        Subject proxy = (Subject) Proxy.newProxyInstance(RealSubject.class.getClassLoader(),
                new Class[]{Subject.class}, jdkDynamicProxy);
        proxy.request();
    }
}